/*
  Inline Labels
  ------------------------------------------------------------------------------
*/

$inline-labels--margin: $ix-border / 2;

.inline-labels {
  width: 100%;
}

.inline-labels--container {
  width: calc(100% + #{$inline-labels--margin * 2});
  position: relative;
  left: $inline-labels--margin * -2;
  display: flex;
  flex-wrap: wrap;
  padding: $inline-labels--margin;

  > .cf-label {
    margin: $inline-labels--margin;
  }
}

/*
  Inline Label Editor Toggle Button
  ------------------------------------------------------------------------------
*/

$label-margin: 1px;
$label-edit-button-diameter: 18px; // Should be the same as the height of labels

.inline-labels--add {
  width: $label-edit-button-diameter;
  height: $label-edit-button-diameter;
  margin: $label-margin;
  position: relative;
  transition: opacity 0.25s ease;

  &:before,
  &:after {
    content: '';
    pointer-events: none;
    background-color: $g20-white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    transition: width 0.25s ease;
    height: $ix-border;
    width: $label-edit-button-diameter - $ix-marg-b;
    border-radius: $ix-border / 2;
  }

  &:after {
    transform: translate(-50%, -50%) rotate(90deg);
  }

  > .cf-button.cf-button-sm {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: $label-edit-button-diameter;
    height: $label-edit-button-diameter;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    color: transparent;
    transition: background-color 0.25s ease, border-color 0.25s ease,
      box-shadow 0.25s ease, height 0.25s ease, width 0.25s ease;

    > .cf-button-icon {
      font-size: $form-sm-font;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
  }

  &:hover > .cf-button.cf-button-sm {
    width: $form-sm-height - $ix-marg-a;
    height: $form-sm-height - $ix-marg-a;
  }

  &:hover:before,
  &:hover:after {
    width: $form-sm-height - $ix-marg-c;
  }
}
